package com.pactera.controller.common.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import springfox.documentation.annotations.ApiIgnore;

/**
 * 类名称：IndexController
 * 类描述：项目根访问类
 * 创建人：lee
 * 创建时间：2018年2月6日 上午11:20:23
 * @version 1.0.0
 */
@ApiIgnore
@Controller
public class IndexController {
	
	private Logger logger = LogManager.getLogger(IndexController.class);
	
	/**
	 * index
	 */
	@RequestMapping("/")
	public String index(ModelMap map) {
		logger.info("go index page");
		return "redirect:/demo";
	}
	
	/**
	 * home
	 */
	@RequestMapping(value = "/home", method = RequestMethod.GET)
    public String home(Model model,HttpServletRequest request) {
		logger.info("go home page");
//		return "redirect:/swagger-ui.html";
		return "/views/demo/Index";
    }
	
	
	/**
	 * layout
	 */
	@RequestMapping(value = "/layout", method = RequestMethod.GET)
    public String layout(Model model,HttpServletRequest request) {
		return "platform/useLayout";
    }
	
	/**
	 * unauthor
	 */
	@RequestMapping("unauthor")
	public String unauthor() {
		logger.info("go unauthor page");
		return "unauthor";
	}
}
